package com.compass.mobile.ui.dialog

import android.app.Dialog
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import androidx.annotation.ColorInt
import androidx.fragment.app.FragmentActivity
import com.compass.mobile.R
import com.compass.mobile.databinding.DialogMessageBinding
import com.compass.mobile.databinding.DialogSetPatientBinding
import com.compass.mobile.framework.base.BaseDialog
import com.compass.mobile.framework.base.BaseDialogFragment
import com.compass.mobile.framework.ext.onClick
import com.compass.mobile.framework.utils.FocusViewUtils

/**
 * Description： 设置就诊人
 * Date:2024/6/12 17:31
 */
class SetPatientDialog {

    class Builder(
        activity: FragmentActivity
    ) : BaseDialogFragment.Builder<Builder>(activity) {
        private val mBinding: DialogSetPatientBinding =
            DialogSetPatientBinding.inflate(LayoutInflater.from(activity))

        private var mAutoDismiss = true // 设置点击按钮后自动消失

        init {
            setContentView(mBinding.root)
            setWidth((AppManager.getScreenHeightPx() * 0.6).toInt())
            setAnimStyle(BaseDialog.AnimStyle.DEFAULT)
            setGravity(Gravity.CENTER)
        }



        fun setonConfirmListener(onConfirm: (dialog: Dialog?) -> Unit): Builder {
            mBinding.llDelete.onClick {
                onConfirm?.invoke(dialog)
            }
            return this
        }

        fun setonCancelListener(onCancel: (dialog: Dialog?) -> Unit): Builder {
            mBinding.llSwitch.onClick {
                onCancel?.invoke(dialog)
            }
            return this
        }

    }
}